package STUDENT.TRANDAODAIVI.ARRAY;
import java.util.Scanner;
public class BT6 {
	public static void main(String[] args) {
		
		Scanner input=new Scanner(System.in);
		System.out.print("Nhap tong so sinh vien: ");
		int temp=input.nextInt();
		input=new Scanner(System.in);
		String array1[]=new String[temp];
		String array2[]=new String[temp];
		float  array3[]=new float[temp];
		for (int i=0;i<temp;i++){
			System.out.print("Nhap ma so sinh vien thu "+(i+1)+" : ");
			array1[i]=input.nextLine();
			System.out.print("Nhap ten sinh vien thu "+(i+1)+"   : ");
			array2[i]=input.nextLine();
			System.out.print("Nhap diem sinh vien thu "+(i+1)+"  : ");
			array3[i]=input.nextFloat();
			input=new Scanner(System.in);
		}
		for (int i=0;i<temp;i++){
			for (int j=i+1;j<temp;j++){
				if (array3[i]<array3[j]){
					float x=array3[i];
					array3[i]=array3[j];
					array3[j]=x;
					
					String y=array1[i];
					array1[i]=array1[j];
					array1[j]=y;
					
					String z=array2[i];
					array2[i]=array2[j];
					array2[j]=z;
				}
			}
		}
		System.out.println("Sap xep theo thu tu giam dan");
		for (int i=0;i<temp;i++){
			System.out.println((i+1)+". "+array1[i]+" "+array2[i]+" "+array3[i]);
		}
	}
	
	
}
